</br>

<%= form_for(@user) do |f| %>
  <% if @user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

      <ul>
      <% @user.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

<%= f.label "Surname" %><br />
<center>
<%= f.text_field :name %>
</center>
</br>
<%= f.label :firstname %>
<center>
<%= f.text_field :firstname %>
</center>
</br>
<%= f.label :username%>
<center>
<%= f.text_field :username %>
</center>
</br>
<% if not admin? %>
<%= f.label :password%>
<center>
<%= f.password_field :password %>
</center>
</br>
<%= f.label :password_confirmation %>
<center>
<%= f.password_field :password_confirmation %>
</center>
<% end%>
</br>
<%= f.label :email%>
<center>
<%= f.text_field :email %>
</center>
</br>
<% time = Time.new %>
<%= f.label 'Birth year'%>
<center>
<%= f.number_field :age, :max => time.year - 18 %>
</center>
</br>
<%= f.label  'Gender:' %>
<center>
<%= f.select :sex, [['',''],['Female','Female'],['Male','Male']] %>
</center>
</br>
<%= f.label 'Interested in:' %>
<center>
<%= f.select :interest, [['',''],['Female','Female'],['Male','Male'],['Both','Both']] %>
</center>
</br>

<%= f.label 'City' %>
<center>
<%= f.text_field :adress %>
</center>
</br>
</br>
</br>
<%= f.label :description %>
<center>
<%= f.text_area :description %>
</center>
</br>
<% if admin? %>
<%= f.label  'Online:' %>
<center>
<%= f.select :online, [['',''],['Yes',true],['No',false]] %>
</center>
</br>
<%= f.label  'Admin:' %>
<center>
<%= f.select :admin, [['',''],['Yes',true],['No',false]] %>
</center>

<%end%>
</br>
</br>
<center>
<%= f.submit ' Sign up '%>
</center>
<% end %>
